package com.example.resule;

/**
 * @author zhanghuaxi
 * @author Administrator
 * @program:
 * @description:
 * @date 2020-12-10 17:00:40
 */
public enum ResultEnum implements CustomizeResultCode {
    SUCCESS(200, "成功"),
    LOGIN_SUCCESS(200, "成功"),
    ERROR(201, "失败"),
    WAIT(1111, "正在处理结果"),
    LOGIN_ERROR(201, "账号或者密码错误,请重新输入"),
    LOGIN_ERROR_EMPTY(201, "账号或者密码不能存在,请重新输入"),
    LOGIN_ERROR_USER(10000, "请重新登陆!"),

    ERROR_Insert(500, "联系后台人员,系统存在故障!"),
    NOT_FOUND(404, "当客户端所请求的URI不对应于任何资源时"),
    AUTHENTIFICATION(401, "请求用户认证"),
    FORBIDDEN(403, "没有权限,请联系管理员申请"),


    /* 参数错误：1000～1999 */
    PARAM_NOT_VALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_ERROR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1004, "参数缺失"),

    /* 用户错误 */
    USER_NOT_LOGIN(2001, "用户未登录"),
    USER_ACCOUNT_EXPIRED(2002, "账号已过期"),
    USER_CREDENTIALS_ERROR(2003, "密码错误"),
    USER_CREDENTIALS_EXPIRED(2004, "密码过期"),
    USER_ACCOUNT_DISABLE(2005, "账号不可用"),
    USER_ACCOUNT_LOCKED(2006, "账号被锁定"),
    USER_ACCOUNT_NOT_EXIST(2007, "账号不存在"),
    USER_ACCOUNT_ALREADY_EXIST(2008, "账号已存在"),
    USER_ACCOUNT_USE_BY_OTHERS(2009, "您的登录已经超时或者已经在另一台机器登录，您被迫下线"),
    USER_SESSION_INVALID(2010, "登录已经超时"),
    /* 业务错误 */
    NO_PERMISSION(4001, "没有权限"),

    /*部门错误*/
    DEPARTMENT_NOT_EXIST(5007, "部门不存在"),
    DEPARTMENT_ALREADY_EXIST(5008, "部门已存在"),

    /*运行时异常*/
    ARITHMETIC_EXCEPTION(9001, "算数异常"),
    NULL_POINTER_EXCEPTION(9002, "空指针异常"),
    ARRAY_INDEX_OUTOfBOUNDS_EXCEPTION(9003, "数组越界"),
    /*redis连接超时*/

    SERVICE_CONNECTION_TIME(500, "服务连接超时"),
    /**
     * 微信公众号模板推送
     */

    SIGNATURE_VERIFICATION(40001, "签名验证错误");


    private Integer code;

    private String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }


}
